home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 1.iso / HENSA / MISC / LINEEDIT.ARC / Rebinder (.txt) < prev    next >
Encoding:
RISC OS BBC BASIC V Source  |  1998-10-20  |  2.4 KB  |  126 lines

  1.  >Rebinder
  2. "This program modifies the LineEditor module on disk to"
  3. "change the key bindings."
  4. '"You need to input the name of the file with the new"
  5. "keybindings in."'
  6. $M$="<LineEditor$Dir>.LineEditor"
  7.  M$:len%=
  8.  v$,N%
  9.  T$(N%)
  10.  C% N%, M% len%
  11.  "OS_File",&FF,M$,M%,0
  12. T%=M%+len%-512
  13.  L%=0 
  14.  N%-1
  15.  T$(L%),C%?L%
  16.  T$(L%)="vanilla" v%=L%
  17.  v%=-1 
  18. "No vanilla in key table":
  19. z(M%+M%!20),"Line Editor"+
  20. 9+v$)<>1 
  21. "Incorrect key file version for module":
  22.  "Key definitions file (RETURN for default): "F$
  23.  F$="" F$="<LineEditor$Dir>.DfltKeys"
  24. WS$=" "+
  25. ::DIM XXX% 512:FOR L%=0 TO 511:XXX%?L%=T%?L%:NEXT
  26.  L%=0 
  27.  511:T%?L%=C%?v%:
  28. L$,"&")
  29.   T$=
  30. L$,I%)
  31.  HACKARAMA
  32. !1  I%=
  33. T$,"-"):
  34.  I% T$=
  35. T$,I%-1)+"~"+
  36. T$,I%+1)
  37.   K%=
  38. T$:K2%=K%
  39. T$,2)
  40. "0123456789ABCDEFabcdef",
  41. T$,1))=0 
  42.  T$=""
  43. T$,1)="~" 
  44.    T$=
  45. T$,2)
  46. T$,1)<>"&" T$="&"+T$
  47.    K2%=
  48. T$,2)
  49. *4   
  50. "0123456789ABCDEFabcdef",
  51. T$,1))=0 
  52.  T$=""
  53. T$,1)) 
  54.  T$<>""
  55.    T$=
  56. T$,2)
  57.  T$ is the action token for key codes K% to K2%
  58.  force to upper-case
  59. 13  t$=T$:T$="":
  60.  L%=1
  61. t$:T$+=
  62. t$,L%,1)
  63.   t%=0
  64.  T$<>T$(t%) 
  65.  t%<N%
  66.    t%+=1
  67.  t%=N% 
  68. "Bad TOKEN '"T$"'":
  69.  K%<0 
  70.  K%>&1FF 
  71.  K2%<0 
  72.  K2%>&1FF 
  73. "Bad key number":
  74. ::PRINTK%"-";K2%" ";t%
  75.  L%=K% 
  76.  K2%:T%?L%=C%?t%:
  77.  "OS_File",&0A,M$,&FFA,,M%,M%+len%
  78.  "OS_Module",11,M%,len%
  79. ::FOR L%=0 TO 511:IF XXX%?L%<>T%?L% PRINTL%" ";XXX%?L%"->";T%?L%:N.ELSEN.
  80. z(A%):
  81.  ?A%:A$+=
  82. ?A%:A%+=1:
  83.  2.73
  84.  ignore,46
  85.  beepignore,55
  86.  left,1
  87.  right,5
  88.  delword,88
  89.  cright,10
  90.  cleft,14
  91.  sright,18
  92.  sleft,26
  93.  toggleinsert,39
  94.  delline,44
  95.  removeline,41
  96.  complete,50
  97.  completenext,51
  98.  completeprev,52
  99.  setmark,54
  100.  copy,56
  101.  swapmark,67
  102.  cut,76
  103.  deletenext,98
  104.  delete,111
  105.  wipehistory,123
  106.  deltoend,75
  107.  paste,128
  108.  swapchars,135
  109.  quote,148
  110.  vanilla,156
  111.  cup,171
  112.  cdown,180
  113.  up,196
  114.  down,211
  115.  sup,221
  116.  sdown,222
  117.  escape,223
  118.  fnkey,242
  119.  wipeallhistory,126
  120.  enter,231
  121.  return,235
  122.  uncopy,229
  123.  showcomp,47
  124.  completeshow,49
  125.  fileropen,0
  126.